export const formatDate = (val: string) => {

    if (!val) return ''

    let time = new Date(val)
    let year = time.getFullYear()
    let month = time.getMonth() + 1
    let day = time.getDate()

    let hours = time.getHours()
    let minute = time.getMinutes()
    let second = time.getSeconds()

    return `${year}-${month < 10 ? '0' + month : month}-${day < 10 ? '0' + day : day} ${hours < 10 ? '0' + hours : hours}:${minute < 10 ? '0' + minute : minute}:${second < 10 ? '0' + second : second}`

}